package com.example.cores_activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.example.cores_activity.utils.DateUtil;

import java.util.Date;

public class SendActivity extends AppCompatActivity implements View.OnClickListener {
    TextView tv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_send);

        findViewById(R.id.btn_send).setOnClickListener(this);
        tv = findViewById(R.id.tv_msg);
    }

    @Override
    public void onClick(View view) {
        String requestTime = DateUtil.getNowTime();
        String requestContent = tv.getText().toString();
        // 创建意图
        Intent intent = new Intent(this, ReceiveActive.class);
        // 创建Bundle,并设置键值
        Bundle bundle = new Bundle();
        bundle.putString("request_time", requestTime);
        bundle.putString("request_content", requestContent);
        // 添加bundle到意图
        intent.putExtras(bundle);

        startActivity(intent);

    }
}